﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbEntityHyperlinkPE : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbEntityHyperlinkPE(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbEntityHyperlinkPE_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbEntityHyperlinkPE obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbEntityHyperlinkPE()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbEntityHyperlinkPE(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbEntityHyperlinkPE cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_cast(OdRxObject.getCPtr(pObj));
			OdDbEntityHyperlinkPE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbEntityHyperlinkPE_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbEntityHyperlinkPE_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbEntityHyperlinkPE_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdDbEntityHyperlinkPE createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_createObject();
			OdDbEntityHyperlinkPE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbEntityHyperlinkPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(OdRxObject pObject, bool oneOnly, bool ignoreBlockDefinition)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_0(this.swigCPtr, OdRxObject.getCPtr(pObject), oneOnly, ignoreBlockDefinition);
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(OdRxObject pObject, bool oneOnly)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_1(this.swigCPtr, OdRxObject.getCPtr(pObject), oneOnly);
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(OdRxObject pObject)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_2(this.swigCPtr, OdRxObject.getCPtr(pObject));
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(SWIGTYPE_p_p_OdDbStubPtrArray objectIds, bool oneOnly, bool ignoreBlockDefinition)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_3(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(objectIds), oneOnly, ignoreBlockDefinition);
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(SWIGTYPE_p_p_OdDbStubPtrArray objectIds, bool oneOnly)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_4(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(objectIds), oneOnly);
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbHyperlinkCollection getHyperlinkCollection(SWIGTYPE_p_p_OdDbStubPtrArray objectIds)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCollection__SWIG_5(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(objectIds));
			OdDbHyperlinkCollection result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHyperlinkCollection)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHyperlinkCollection(OdRxObject pObject, OdDbHyperlinkCollection pHCO)
		{
			TD_DbPINVOKE.OdDbEntityHyperlinkPE_setHyperlinkCollection(this.swigCPtr, OdRxObject.getCPtr(pObject), OdDbHyperlinkCollection.getCPtr(pHCO));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint getHyperlinkCount(OdRxObject pObject, bool ignoreBlockDefinition)
		{
			uint result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCount__SWIG_0(this.swigCPtr, OdRxObject.getCPtr(pObject), ignoreBlockDefinition);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint getHyperlinkCount(OdRxObject pObject)
		{
			uint result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCount__SWIG_1(this.swigCPtr, OdRxObject.getCPtr(pObject));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint getHyperlinkCount(SWIGTYPE_p_p_OdDbStubPtrArray idContainers, bool ignoreBlockDefinition)
		{
			uint result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCount__SWIG_2(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(idContainers), ignoreBlockDefinition);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint getHyperlinkCount(SWIGTYPE_p_p_OdDbStubPtrArray idContainers)
		{
			uint result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_getHyperlinkCount__SWIG_3(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(idContainers));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool hasHyperlink(OdRxObject pObject, bool ignoreBlockDefinition)
		{
			bool result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_hasHyperlink__SWIG_0(this.swigCPtr, OdRxObject.getCPtr(pObject), ignoreBlockDefinition);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool hasHyperlink(OdRxObject pObject)
		{
			bool result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_hasHyperlink__SWIG_1(this.swigCPtr, OdRxObject.getCPtr(pObject));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool hasHyperlink(SWIGTYPE_p_p_OdDbStubPtrArray objectIds, bool ignoreBlockDefinition)
		{
			bool result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_hasHyperlink__SWIG_2(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(objectIds), ignoreBlockDefinition);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool hasHyperlink(SWIGTYPE_p_p_OdDbStubPtrArray objectIds)
		{
			bool result = TD_DbPINVOKE.OdDbEntityHyperlinkPE_hasHyperlink__SWIG_3(this.swigCPtr, SWIGTYPE_p_p_OdDbStubPtrArray.getCPtr(objectIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
